#ifndef PARAMETERS_H
#define PARAMETERS_H

/*
	FUNÇÕES RESPONSÁVEIS PELA MANIPULAÇÃO DE DIRETÓRIOS
	Autor: Vinícius Bueno
*/

#include <string.h>
#include <stdio.h>
#include <stdlib.h>

#include <time.h>

#include "enums.h"
#include "request.h"
/*******************************************************************************
 * DEFINES DOS PARAMETROS VINDOS NO CABEÇALHO DE ACORDO COM A RFC2616
 ******************************************************************************/

#define ACCEPT                  "Accept:"
#define ACCEPT_CHARSET          "Accept-Charset:"
#define ACCEPT_ENCODING         "Accept-Encoding:"
#define ACCEPT_LANGUAGE         "Accept-Language:"
#define ACCEPT_RANGES           "Accept-Ranges:"
#define AGE                     "Age:"
#define ALLOW                   "Allow:"
#define AUTHORIZATION           "Authorization:"
#define CACHE_CONTROL           "Cache-Control:"
#define CONNECTION              "Connection:"
#define CONTENT_ENCODING        "Content-Encoding:"
#define CONTENT_LANGUAGE        "Content-Language:"
#define CONTENT_LENGTH          "Content-Length:"
#define CONTENT_LOCATION        "Content-Location:"
#define CONTENT_MD5             "Content-MD5:"
#define CONTENT_RANGE           "Content-Range:"
#define CONTENT_TYPE            "Content-Type:"
#define DATE                    "Date:"
#define ETAG                    "ETag:"
#define EXPECT                  "Expect:"
#define EXPIRES                 "Expires:"
#define FROM                    "From:"
#define HOST                    "Host:"
#define IF_MATCH                "If-Match:"
#define IF_MODIFIED_SINCE       "If-Modified-Since:"
#define IF_NONE_MATCH           "If-None-Match:"
#define IF_RANGE                "If-Range:"
#define IF_UNMODIFIED_SINCE     "If-Unmodified-Since:"
#define LAST_MODIFIED           "Last-Modified:"
#define LOCATION                "Location:"
#define MAX_FORWARDS            "Max-Forwards:"
#define PRAGMA                  "Pragma:"
#define PROXY_AUTHENTICATE      "Proxy-Authenticate:"
#define PROXY_AUTHORIZATION     "Proxy-Authorization:"
#define RANGE                   "Range:"
#define REFERER                 "Referer:"
#define RETRY_AFTER             "Retry-After:"
#define SERVER                  "Server:"
#define TE                      "TE:"
#define TRAILER                 "Trailer:"
#define TRANSFER_ENCODING       "Transfer-Encoding:"
#define UPGRADE                 "Upgrade:"
#define USER_AGENT              "User-Agent:"
#define VARY                    "Vary:"
#define VIA                     "Via:"
#define WARNING                 "Warning:"
#define WWW_AUTHENTICATE        "WWW-Authenticate:"

/*******************************************************************************
 *        INÍCIO DAS FUNÇÕES DE TRATAMENTO DOS PARÂMETROS DE CABEÇALHOS
 *
 *  se não for possível retornar o valor a ser atribuído no header_data, passar
 *  como parâmetro apenas o campo do header_data que precisa ser setado.
 ******************************************************************************/

int get_parameter(vstring **line);

int get_method(vstring **value);

int get_number(vstring **line);

int get_connection(vstring **line);

struct tm* get_date(vstring **line);

void get_host(vstring **line,header_data **hd);

int get_transfer_encoding(vstring **line);

#endif